/**
 * 
 */
package edu.cmu.mism.dgjava.jobs;


/**
 * @author Christian
 * 
 */
public class OptionCalculationJobManager {
	private static OptionCalculationJobManager instance;
	private OptionCalculationJob lastCal;

	private OptionCalculationJobManager() {
	}

	/**
	 * 
	 * @return
	 */
	public static OptionCalculationJobManager getInstance() {
		if (instance == null) {
			instance = new OptionCalculationJobManager();
		}
		return instance;
	}

	/**
	 * Create a new option calculation job instances
	 * 
	 * @param underlyingModel
	 *            the underlying model object
	 * @param pricingModel
	 *            the pricing model object
	 * @return
	 */
	public OptionCalculationJob newOptionCalculationJob(Object underlyingModel,
			Object pricingModel) {
		OptionCalculationJob j = new OptionCalculationJob(underlyingModel,
				pricingModel);
		this.lastCal = j;
		return j;
	}

	/**
	 * Finds the last calculation job instance
	 * 
	 * @return
	 */
	public OptionCalculationJob getLastCalculation() {
		return lastCal;
	}
}
